# imports
from keras.applications.resnet import ResNet50
from keras.models import Model, Input
from keras.layers import Dense, Conv2D, MaxPool2D, Dropout
from keras.layers import Flatten
from keras.applications.vgg16 import decode_predictions
from keras.models import Sequential
from keras.optimizers import Adam, Adamax
import glob
import matplotlib.pyplot as plt
from PIL import Image
import numpy as np
import tensorflow as tf
seed = 1
np.random.seed(seed)
tf.random.set_seed(seed)
# load data
X = []
Y = []
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/anger/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(1) # anger class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/disgust/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(2) # disgust class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/fear/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(3) # fear class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/happy/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(4) # happy class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/neutral/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(5) # neutral class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/sad/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(6) # sad class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/surprised/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(7) # surprised class
# convert to np array
X = np.array(X)
# reshape
X = X.reshape(X.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
X = X /255
# encode outputs
Y = np.array(Y)
# randomize the data set - numpy arrays
randomize = np.arange(len(X))
np.random.shuffle(randomize)
X = X[randomize]
Y = Y[randomize]
Y = tf.keras.utils.to_categorical(Y)
num_classes = Y.shape[1]
resnet = ResNet50(include_top=False, weights='imagenet', input_shape=(224,224,3))
output = resnet.layers[-1].output
output = tf.keras.layers.Flatten()(output)
resnet = Model(resnet.input, outputs=output)
for layer in resnet.layers:
layer.trainable = False
resnet.summary()
Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/resnet/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5
94773248/94765736 [==============================] - 1s 0us/step
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 224, 224, 3) 0
__________________________________________________________________________________________________
conv1_pad (ZeroPadding2D) (None, 230, 230, 3) 0 input_1[0][0]
__________________________________________________________________________________________________
conv1_conv (Conv2D) (None, 112, 112, 64) 9472 conv1_pad[0][0]
__________________________________________________________________________________________________
conv1_bn (BatchNormalization) (None, 112, 112, 64) 256 conv1_conv[0][0]
__________________________________________________________________________________________________
conv1_relu (Activation) (None, 112, 112, 64) 0 conv1_bn[0][0]
__________________________________________________________________________________________________
pool1_pad (ZeroPadding2D) (None, 114, 114, 64) 0 conv1_relu[0][0]
__________________________________________________________________________________________________
pool1_pool (MaxPooling2D) (None, 56, 56, 64) 0 pool1_pad[0][0]
__________________________________________________________________________________________________
conv2_block1_1_conv (Conv2D) (None, 56, 56, 64) 4160 pool1_pool[0][0]
__________________________________________________________________________________________________
conv2_block1_1_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block1_1_conv[0][0]
__________________________________________________________________________________________________
conv2_block1_1_relu (Activation (None, 56, 56, 64) 0 conv2_block1_1_bn[0][0]
__________________________________________________________________________________________________
conv2_block1_2_conv (Conv2D) (None, 56, 56, 64) 36928 conv2_block1_1_relu[0][0]
__________________________________________________________________________________________________
conv2_block1_2_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block1_2_conv[0][0]
__________________________________________________________________________________________________
conv2_block1_2_relu (Activation (None, 56, 56, 64) 0 conv2_block1_2_bn[0][0]
__________________________________________________________________________________________________
conv2_block1_0_conv (Conv2D) (None, 56, 56, 256) 16640 pool1_pool[0][0]
__________________________________________________________________________________________________
conv2_block1_3_conv (Conv2D) (None, 56, 56, 256) 16640 conv2_block1_2_relu[0][0]
__________________________________________________________________________________________________
conv2_block1_0_bn (BatchNormali (None, 56, 56, 256) 1024 conv2_block1_0_conv[0][0]
__________________________________________________________________________________________________
conv2_block1_3_bn (BatchNormali (None, 56, 56, 256) 1024 conv2_block1_3_conv[0][0]
__________________________________________________________________________________________________
conv2_block1_add (Add) (None, 56, 56, 256) 0 conv2_block1_0_bn[0][0]
conv2_block1_3_bn[0][0]
__________________________________________________________________________________________________
conv2_block1_out (Activation) (None, 56, 56, 256) 0 conv2_block1_add[0][0]
__________________________________________________________________________________________________
conv2_block2_1_conv (Conv2D) (None, 56, 56, 64) 16448 conv2_block1_out[0][0]
__________________________________________________________________________________________________
conv2_block2_1_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block2_1_conv[0][0]
__________________________________________________________________________________________________
conv2_block2_1_relu (Activation (None, 56, 56, 64) 0 conv2_block2_1_bn[0][0]
__________________________________________________________________________________________________
conv2_block2_2_conv (Conv2D) (None, 56, 56, 64) 36928 conv2_block2_1_relu[0][0]
__________________________________________________________________________________________________
conv2_block2_2_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block2_2_conv[0][0]
__________________________________________________________________________________________________
conv2_block2_2_relu (Activation (None, 56, 56, 64) 0 conv2_block2_2_bn[0][0]
__________________________________________________________________________________________________
conv2_block2_3_conv (Conv2D) (None, 56, 56, 256) 16640 conv2_block2_2_relu[0][0]
__________________________________________________________________________________________________
conv2_block2_3_bn (BatchNormali (None, 56, 56, 256) 1024 conv2_block2_3_conv[0][0]
__________________________________________________________________________________________________
conv2_block2_add (Add) (None, 56, 56, 256) 0 conv2_block1_out[0][0]
conv2_block2_3_bn[0][0]
__________________________________________________________________________________________________
conv2_block2_out (Activation) (None, 56, 56, 256) 0 conv2_block2_add[0][0]
__________________________________________________________________________________________________
conv2_block3_1_conv (Conv2D) (None, 56, 56, 64) 16448 conv2_block2_out[0][0]
__________________________________________________________________________________________________
conv2_block3_1_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block3_1_conv[0][0]
__________________________________________________________________________________________________
conv2_block3_1_relu (Activation (None, 56, 56, 64) 0 conv2_block3_1_bn[0][0]
__________________________________________________________________________________________________
conv2_block3_2_conv (Conv2D) (None, 56, 56, 64) 36928 conv2_block3_1_relu[0][0]
__________________________________________________________________________________________________
conv2_block3_2_bn (BatchNormali (None, 56, 56, 64) 256 conv2_block3_2_conv[0][0]
__________________________________________________________________________________________________
conv2_block3_2_relu (Activation (None, 56, 56, 64) 0 conv2_block3_2_bn[0][0]
__________________________________________________________________________________________________
conv2_block3_3_conv (Conv2D) (None, 56, 56, 256) 16640 conv2_block3_2_relu[0][0]
__________________________________________________________________________________________________
conv2_block3_3_bn (BatchNormali (None, 56, 56, 256) 1024 conv2_block3_3_conv[0][0]
__________________________________________________________________________________________________
conv2_block3_add (Add) (None, 56, 56, 256) 0 conv2_block2_out[0][0]
conv2_block3_3_bn[0][0]
__________________________________________________________________________________________________
conv2_block3_out (Activation) (None, 56, 56, 256) 0 conv2_block3_add[0][0]
__________________________________________________________________________________________________
conv3_block1_1_conv (Conv2D) (None, 28, 28, 128) 32896 conv2_block3_out[0][0]
__________________________________________________________________________________________________
conv3_block1_1_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block1_1_conv[0][0]
__________________________________________________________________________________________________
conv3_block1_1_relu (Activation (None, 28, 28, 128) 0 conv3_block1_1_bn[0][0]
__________________________________________________________________________________________________
conv3_block1_2_conv (Conv2D) (None, 28, 28, 128) 147584 conv3_block1_1_relu[0][0]
__________________________________________________________________________________________________
conv3_block1_2_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block1_2_conv[0][0]
__________________________________________________________________________________________________
conv3_block1_2_relu (Activation (None, 28, 28, 128) 0 conv3_block1_2_bn[0][0]
__________________________________________________________________________________________________
conv3_block1_0_conv (Conv2D) (None, 28, 28, 512) 131584 conv2_block3_out[0][0]
__________________________________________________________________________________________________
conv3_block1_3_conv (Conv2D) (None, 28, 28, 512) 66048 conv3_block1_2_relu[0][0]
__________________________________________________________________________________________________
conv3_block1_0_bn (BatchNormali (None, 28, 28, 512) 2048 conv3_block1_0_conv[0][0]
__________________________________________________________________________________________________
conv3_block1_3_bn (BatchNormali (None, 28, 28, 512) 2048 conv3_block1_3_conv[0][0]
__________________________________________________________________________________________________
conv3_block1_add (Add) (None, 28, 28, 512) 0 conv3_block1_0_bn[0][0]
conv3_block1_3_bn[0][0]
__________________________________________________________________________________________________
conv3_block1_out (Activation) (None, 28, 28, 512) 0 conv3_block1_add[0][0]
__________________________________________________________________________________________________
conv3_block2_1_conv (Conv2D) (None, 28, 28, 128) 65664 conv3_block1_out[0][0]
__________________________________________________________________________________________________
conv3_block2_1_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block2_1_conv[0][0]
__________________________________________________________________________________________________
conv3_block2_1_relu (Activation (None, 28, 28, 128) 0 conv3_block2_1_bn[0][0]
__________________________________________________________________________________________________
conv3_block2_2_conv (Conv2D) (None, 28, 28, 128) 147584 conv3_block2_1_relu[0][0]
__________________________________________________________________________________________________
conv3_block2_2_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block2_2_conv[0][0]
__________________________________________________________________________________________________
conv3_block2_2_relu (Activation (None, 28, 28, 128) 0 conv3_block2_2_bn[0][0]
__________________________________________________________________________________________________
conv3_block2_3_conv (Conv2D) (None, 28, 28, 512) 66048 conv3_block2_2_relu[0][0]
__________________________________________________________________________________________________
conv3_block2_3_bn (BatchNormali (None, 28, 28, 512) 2048 conv3_block2_3_conv[0][0]
__________________________________________________________________________________________________
conv3_block2_add (Add) (None, 28, 28, 512) 0 conv3_block1_out[0][0]
conv3_block2_3_bn[0][0]
__________________________________________________________________________________________________
conv3_block2_out (Activation) (None, 28, 28, 512) 0 conv3_block2_add[0][0]
__________________________________________________________________________________________________
conv3_block3_1_conv (Conv2D) (None, 28, 28, 128) 65664 conv3_block2_out[0][0]
__________________________________________________________________________________________________
conv3_block3_1_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block3_1_conv[0][0]
__________________________________________________________________________________________________
conv3_block3_1_relu (Activation (None, 28, 28, 128) 0 conv3_block3_1_bn[0][0]
__________________________________________________________________________________________________
conv3_block3_2_conv (Conv2D) (None, 28, 28, 128) 147584 conv3_block3_1_relu[0][0]
__________________________________________________________________________________________________
conv3_block3_2_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block3_2_conv[0][0]
__________________________________________________________________________________________________
conv3_block3_2_relu (Activation (None, 28, 28, 128) 0 conv3_block3_2_bn[0][0]
__________________________________________________________________________________________________
conv3_block3_3_conv (Conv2D) (None, 28, 28, 512) 66048 conv3_block3_2_relu[0][0]
__________________________________________________________________________________________________
conv3_block3_3_bn (BatchNormali (None, 28, 28, 512) 2048 conv3_block3_3_conv[0][0]
__________________________________________________________________________________________________
conv3_block3_add (Add) (None, 28, 28, 512) 0 conv3_block2_out[0][0]
conv3_block3_3_bn[0][0]
__________________________________________________________________________________________________
conv3_block3_out (Activation) (None, 28, 28, 512) 0 conv3_block3_add[0][0]
__________________________________________________________________________________________________
conv3_block4_1_conv (Conv2D) (None, 28, 28, 128) 65664 conv3_block3_out[0][0]
__________________________________________________________________________________________________
conv3_block4_1_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block4_1_conv[0][0]
__________________________________________________________________________________________________
conv3_block4_1_relu (Activation (None, 28, 28, 128) 0 conv3_block4_1_bn[0][0]
__________________________________________________________________________________________________
conv3_block4_2_conv (Conv2D) (None, 28, 28, 128) 147584 conv3_block4_1_relu[0][0]
__________________________________________________________________________________________________
conv3_block4_2_bn (BatchNormali (None, 28, 28, 128) 512 conv3_block4_2_conv[0][0]
__________________________________________________________________________________________________
conv3_block4_2_relu (Activation (None, 28, 28, 128) 0 conv3_block4_2_bn[0][0]
__________________________________________________________________________________________________
conv3_block4_3_conv (Conv2D) (None, 28, 28, 512) 66048 conv3_block4_2_relu[0][0]
__________________________________________________________________________________________________
conv3_block4_3_bn (BatchNormali (None, 28, 28, 512) 2048 conv3_block4_3_conv[0][0]
__________________________________________________________________________________________________
conv3_block4_add (Add) (None, 28, 28, 512) 0 conv3_block3_out[0][0]
conv3_block4_3_bn[0][0]
__________________________________________________________________________________________________
conv3_block4_out (Activation) (None, 28, 28, 512) 0 conv3_block4_add[0][0]
__________________________________________________________________________________________________
conv4_block1_1_conv (Conv2D) (None, 14, 14, 256) 131328 conv3_block4_out[0][0]
__________________________________________________________________________________________________
conv4_block1_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block1_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block1_1_relu (Activation (None, 14, 14, 256) 0 conv4_block1_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block1_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block1_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block1_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block1_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block1_2_relu (Activation (None, 14, 14, 256) 0 conv4_block1_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block1_0_conv (Conv2D) (None, 14, 14, 1024) 525312 conv3_block4_out[0][0]
__________________________________________________________________________________________________
conv4_block1_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block1_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block1_0_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block1_0_conv[0][0]
__________________________________________________________________________________________________
conv4_block1_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block1_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block1_add (Add) (None, 14, 14, 1024) 0 conv4_block1_0_bn[0][0]
conv4_block1_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block1_out (Activation) (None, 14, 14, 1024) 0 conv4_block1_add[0][0]
__________________________________________________________________________________________________
conv4_block2_1_conv (Conv2D) (None, 14, 14, 256) 262400 conv4_block1_out[0][0]
__________________________________________________________________________________________________
conv4_block2_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block2_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block2_1_relu (Activation (None, 14, 14, 256) 0 conv4_block2_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block2_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block2_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block2_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block2_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block2_2_relu (Activation (None, 14, 14, 256) 0 conv4_block2_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block2_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block2_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block2_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block2_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block2_add (Add) (None, 14, 14, 1024) 0 conv4_block1_out[0][0]
conv4_block2_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block2_out (Activation) (None, 14, 14, 1024) 0 conv4_block2_add[0][0]
__________________________________________________________________________________________________
conv4_block3_1_conv (Conv2D) (None, 14, 14, 256) 262400 conv4_block2_out[0][0]
__________________________________________________________________________________________________
conv4_block3_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block3_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block3_1_relu (Activation (None, 14, 14, 256) 0 conv4_block3_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block3_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block3_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block3_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block3_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block3_2_relu (Activation (None, 14, 14, 256) 0 conv4_block3_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block3_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block3_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block3_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block3_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block3_add (Add) (None, 14, 14, 1024) 0 conv4_block2_out[0][0]
conv4_block3_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block3_out (Activation) (None, 14, 14, 1024) 0 conv4_block3_add[0][0]
__________________________________________________________________________________________________
conv4_block4_1_conv (Conv2D) (None, 14, 14, 256) 262400 conv4_block3_out[0][0]
__________________________________________________________________________________________________
conv4_block4_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block4_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block4_1_relu (Activation (None, 14, 14, 256) 0 conv4_block4_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block4_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block4_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block4_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block4_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block4_2_relu (Activation (None, 14, 14, 256) 0 conv4_block4_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block4_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block4_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block4_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block4_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block4_add (Add) (None, 14, 14, 1024) 0 conv4_block3_out[0][0]
conv4_block4_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block4_out (Activation) (None, 14, 14, 1024) 0 conv4_block4_add[0][0]
__________________________________________________________________________________________________
conv4_block5_1_conv (Conv2D) (None, 14, 14, 256) 262400 conv4_block4_out[0][0]
__________________________________________________________________________________________________
conv4_block5_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block5_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block5_1_relu (Activation (None, 14, 14, 256) 0 conv4_block5_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block5_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block5_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block5_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block5_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block5_2_relu (Activation (None, 14, 14, 256) 0 conv4_block5_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block5_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block5_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block5_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block5_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block5_add (Add) (None, 14, 14, 1024) 0 conv4_block4_out[0][0]
conv4_block5_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block5_out (Activation) (None, 14, 14, 1024) 0 conv4_block5_add[0][0]
__________________________________________________________________________________________________
conv4_block6_1_conv (Conv2D) (None, 14, 14, 256) 262400 conv4_block5_out[0][0]
__________________________________________________________________________________________________
conv4_block6_1_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block6_1_conv[0][0]
__________________________________________________________________________________________________
conv4_block6_1_relu (Activation (None, 14, 14, 256) 0 conv4_block6_1_bn[0][0]
__________________________________________________________________________________________________
conv4_block6_2_conv (Conv2D) (None, 14, 14, 256) 590080 conv4_block6_1_relu[0][0]
__________________________________________________________________________________________________
conv4_block6_2_bn (BatchNormali (None, 14, 14, 256) 1024 conv4_block6_2_conv[0][0]
__________________________________________________________________________________________________
conv4_block6_2_relu (Activation (None, 14, 14, 256) 0 conv4_block6_2_bn[0][0]
__________________________________________________________________________________________________
conv4_block6_3_conv (Conv2D) (None, 14, 14, 1024) 263168 conv4_block6_2_relu[0][0]
__________________________________________________________________________________________________
conv4_block6_3_bn (BatchNormali (None, 14, 14, 1024) 4096 conv4_block6_3_conv[0][0]
__________________________________________________________________________________________________
conv4_block6_add (Add) (None, 14, 14, 1024) 0 conv4_block5_out[0][0]
conv4_block6_3_bn[0][0]
__________________________________________________________________________________________________
conv4_block6_out (Activation) (None, 14, 14, 1024) 0 conv4_block6_add[0][0]
__________________________________________________________________________________________________
conv5_block1_1_conv (Conv2D) (None, 7, 7, 512) 524800 conv4_block6_out[0][0]
__________________________________________________________________________________________________
conv5_block1_1_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block1_1_conv[0][0]
__________________________________________________________________________________________________
conv5_block1_1_relu (Activation (None, 7, 7, 512) 0 conv5_block1_1_bn[0][0]
__________________________________________________________________________________________________
conv5_block1_2_conv (Conv2D) (None, 7, 7, 512) 2359808 conv5_block1_1_relu[0][0]
__________________________________________________________________________________________________
conv5_block1_2_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block1_2_conv[0][0]
__________________________________________________________________________________________________
conv5_block1_2_relu (Activation (None, 7, 7, 512) 0 conv5_block1_2_bn[0][0]
__________________________________________________________________________________________________
conv5_block1_0_conv (Conv2D) (None, 7, 7, 2048) 2099200 conv4_block6_out[0][0]
__________________________________________________________________________________________________
conv5_block1_3_conv (Conv2D) (None, 7, 7, 2048) 1050624 conv5_block1_2_relu[0][0]
__________________________________________________________________________________________________
conv5_block1_0_bn (BatchNormali (None, 7, 7, 2048) 8192 conv5_block1_0_conv[0][0]
__________________________________________________________________________________________________
conv5_block1_3_bn (BatchNormali (None, 7, 7, 2048) 8192 conv5_block1_3_conv[0][0]
__________________________________________________________________________________________________
conv5_block1_add (Add) (None, 7, 7, 2048) 0 conv5_block1_0_bn[0][0]
conv5_block1_3_bn[0][0]
__________________________________________________________________________________________________
conv5_block1_out (Activation) (None, 7, 7, 2048) 0 conv5_block1_add[0][0]
__________________________________________________________________________________________________
conv5_block2_1_conv (Conv2D) (None, 7, 7, 512) 1049088 conv5_block1_out[0][0]
__________________________________________________________________________________________________
conv5_block2_1_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block2_1_conv[0][0]
__________________________________________________________________________________________________
conv5_block2_1_relu (Activation (None, 7, 7, 512) 0 conv5_block2_1_bn[0][0]
__________________________________________________________________________________________________
conv5_block2_2_conv (Conv2D) (None, 7, 7, 512) 2359808 conv5_block2_1_relu[0][0]
__________________________________________________________________________________________________
conv5_block2_2_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block2_2_conv[0][0]
__________________________________________________________________________________________________
conv5_block2_2_relu (Activation (None, 7, 7, 512) 0 conv5_block2_2_bn[0][0]
__________________________________________________________________________________________________
conv5_block2_3_conv (Conv2D) (None, 7, 7, 2048) 1050624 conv5_block2_2_relu[0][0]
__________________________________________________________________________________________________
conv5_block2_3_bn (BatchNormali (None, 7, 7, 2048) 8192 conv5_block2_3_conv[0][0]
__________________________________________________________________________________________________
conv5_block2_add (Add) (None, 7, 7, 2048) 0 conv5_block1_out[0][0]
conv5_block2_3_bn[0][0]
__________________________________________________________________________________________________
conv5_block2_out (Activation) (None, 7, 7, 2048) 0 conv5_block2_add[0][0]
__________________________________________________________________________________________________
conv5_block3_1_conv (Conv2D) (None, 7, 7, 512) 1049088 conv5_block2_out[0][0]
__________________________________________________________________________________________________
conv5_block3_1_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block3_1_conv[0][0]
__________________________________________________________________________________________________
conv5_block3_1_relu (Activation (None, 7, 7, 512) 0 conv5_block3_1_bn[0][0]
__________________________________________________________________________________________________
conv5_block3_2_conv (Conv2D) (None, 7, 7, 512) 2359808 conv5_block3_1_relu[0][0]
__________________________________________________________________________________________________
conv5_block3_2_bn (BatchNormali (None, 7, 7, 512) 2048 conv5_block3_2_conv[0][0]
__________________________________________________________________________________________________
conv5_block3_2_relu (Activation (None, 7, 7, 512) 0 conv5_block3_2_bn[0][0]
__________________________________________________________________________________________________
conv5_block3_3_conv (Conv2D) (None, 7, 7, 2048) 1050624 conv5_block3_2_relu[0][0]
__________________________________________________________________________________________________
conv5_block3_3_bn (BatchNormali (None, 7, 7, 2048) 8192 conv5_block3_3_conv[0][0]
__________________________________________________________________________________________________
conv5_block3_add (Add) (None, 7, 7, 2048) 0 conv5_block2_out[0][0]
conv5_block3_3_bn[0][0]
__________________________________________________________________________________________________
conv5_block3_out (Activation) (None, 7, 7, 2048) 0 conv5_block3_add[0][0]
__________________________________________________________________________________________________
flatten (Flatten) (None, 100352) 0 conv5_block3_out[0][0]
==================================================================================================
Total params: 23,587,712
Trainable params: 0
Non-trainable params: 23,587,712
__________________________________________________________________________________________________
# creation of the model, using the resnet architecture and adding my own classes after the flattening layer
model = Sequential()
model.add(resnet)
model.add(Dense(512, activation='relu', input_dim= (224, 224, 3)))
model.add(Dropout(0.3))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.3))
model.add(Dense(num_classes, activation='softmax'))
# summary of the model
model.summary()
# specifying a learning rate to optimizer adam
opt = tf.keras.optimizers.Adam(lr=0.000001)
# compiling the model
model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['acc'])
# Fit the model
history = model.fit(X, Y, validation_split=0.40, epochs=25, batch_size=32, verbose=1)
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
Model: "sequential" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= model (Functional) (None, 100352) 23587712 _________________________________________________________________ dense (Dense) (None, 512) 51380736 _________________________________________________________________ dropout (Dropout) (None, 512) 0 _________________________________________________________________ dense_1 (Dense) (None, 512) 262656 _________________________________________________________________ dropout_1 (Dropout) (None, 512) 0 _________________________________________________________________ dense_2 (Dense) (None, 8) 4104 ================================================================= Total params: 75,235,208 Trainable params: 51,647,496 Non-trainable params: 23,587,712 _________________________________________________________________ Epoch 1/25 112/112 [==============================] - 55s 181ms/step - loss: 2.4391 - acc: 0.1262 - val_loss: 1.7469 - val_acc: 0.2800 Epoch 2/25 112/112 [==============================] - 18s 162ms/step - loss: 1.9399 - acc: 0.2149 - val_loss: 1.7279 - val_acc: 0.2473 Epoch 3/25 112/112 [==============================] - 18s 163ms/step - loss: 1.8573 - acc: 0.2442 - val_loss: 1.7157 - val_acc: 0.2728 Epoch 4/25 112/112 [==============================] - 18s 164ms/step - loss: 1.8452 - acc: 0.2318 - val_loss: 1.7133 - val_acc: 0.2795 Epoch 5/25 112/112 [==============================] - 18s 165ms/step - loss: 1.8142 - acc: 0.2327 - val_loss: 1.7124 - val_acc: 0.2804 Epoch 6/25 112/112 [==============================] - 19s 166ms/step - loss: 1.8217 - acc: 0.2276 - val_loss: 1.7082 - val_acc: 0.2812 Epoch 7/25 112/112 [==============================] - 19s 167ms/step - loss: 1.7848 - acc: 0.2518 - val_loss: 1.7087 - val_acc: 0.3290 Epoch 8/25 112/112 [==============================] - 19s 168ms/step - loss: 1.7945 - acc: 0.2471 - val_loss: 1.7044 - val_acc: 0.2800 Epoch 9/25 112/112 [==============================] - 19s 168ms/step - loss: 1.7674 - acc: 0.2619 - val_loss: 1.7059 - val_acc: 0.3273 Epoch 10/25 112/112 [==============================] - 19s 169ms/step - loss: 1.7900 - acc: 0.2303 - val_loss: 1.7031 - val_acc: 0.2787 Epoch 11/25 112/112 [==============================] - 19s 169ms/step - loss: 1.7705 - acc: 0.2577 - val_loss: 1.7006 - val_acc: 0.2800 Epoch 12/25 112/112 [==============================] - 19s 170ms/step - loss: 1.7762 - acc: 0.2461 - val_loss: 1.6999 - val_acc: 0.2804 Epoch 13/25 112/112 [==============================] - 19s 170ms/step - loss: 1.7725 - acc: 0.2532 - val_loss: 1.6980 - val_acc: 0.2804 Epoch 14/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7765 - acc: 0.2481 - val_loss: 1.6972 - val_acc: 0.2791 Epoch 15/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7618 - acc: 0.2573 - val_loss: 1.6956 - val_acc: 0.2795 Epoch 16/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7400 - acc: 0.2809 - val_loss: 1.6941 - val_acc: 0.3001 Epoch 17/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7483 - acc: 0.2575 - val_loss: 1.6920 - val_acc: 0.2787 Epoch 18/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7681 - acc: 0.2658 - val_loss: 1.6906 - val_acc: 0.2804 Epoch 19/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7382 - acc: 0.2836 - val_loss: 1.6896 - val_acc: 0.2791 Epoch 20/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7472 - acc: 0.2703 - val_loss: 1.6905 - val_acc: 0.3755 Epoch 21/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7364 - acc: 0.2676 - val_loss: 1.6838 - val_acc: 0.2795 Epoch 22/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7403 - acc: 0.2662 - val_loss: 1.6829 - val_acc: 0.2791 Epoch 23/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7370 - acc: 0.2681 - val_loss: 1.6795 - val_acc: 0.2808 Epoch 24/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7278 - acc: 0.2759 - val_loss: 1.6787 - val_acc: 0.2804 Epoch 25/25 112/112 [==============================] - 19s 171ms/step - loss: 1.7345 - acc: 0.2666 - val_loss: 1.6791 - val_acc: 0.2791
# creation of the model, using the resnet architecture and adding my own classes after the flattening layer
model2 = Sequential()
model2.add(resnet)
model2.add(Dense(512, activation='relu', input_dim= (224, 224, 3)))
model2.add(Dense(512, activation='relu'))
model2.add(Dense(num_classes, activation='softmax'))
# summary of the model
model2.summary()
# specifying a learning rate to optimizer adam
opt = tf.keras.optimizers.Adam(lr=0.0001)
# compiling the model
model2.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['acc'])
# Fit the model
history = model2.fit(X, Y, validation_split=0.33, epochs=50, batch_size=64, verbose=1)
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
Model: "sequential_8" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= model (Functional) (None, 100352) 23587712 _________________________________________________________________ dense_29 (Dense) (None, 512) 51380736 _________________________________________________________________ dense_30 (Dense) (None, 512) 262656 _________________________________________________________________ dense_31 (Dense) (None, 8) 4104 ================================================================= Total params: 75,235,208 Trainable params: 51,647,496 Non-trainable params: 23,587,712 _________________________________________________________________ Epoch 1/50 63/63 [==============================] - 23s 322ms/step - loss: 1.8961 - acc: 0.2459 - val_loss: 1.6890 - val_acc: 0.3028 Epoch 2/50 63/63 [==============================] - 19s 297ms/step - loss: 1.7277 - acc: 0.2960 - val_loss: 1.5966 - val_acc: 0.3537 Epoch 3/50 63/63 [==============================] - 18s 289ms/step - loss: 1.6647 - acc: 0.3226 - val_loss: 1.5962 - val_acc: 0.2942 Epoch 4/50 63/63 [==============================] - 18s 291ms/step - loss: 1.6198 - acc: 0.3434 - val_loss: 1.5757 - val_acc: 0.2952 Epoch 5/50 63/63 [==============================] - 18s 294ms/step - loss: 1.5756 - acc: 0.3892 - val_loss: 1.5443 - val_acc: 0.3821 Epoch 6/50 63/63 [==============================] - 19s 296ms/step - loss: 1.5550 - acc: 0.3885 - val_loss: 1.5385 - val_acc: 0.5147 Epoch 7/50 63/63 [==============================] - 18s 295ms/step - loss: 1.5324 - acc: 0.4158 - val_loss: 1.4837 - val_acc: 0.4192 Epoch 8/50 63/63 [==============================] - 18s 293ms/step - loss: 1.4787 - acc: 0.4370 - val_loss: 1.4514 - val_acc: 0.4507 Epoch 9/50 63/63 [==============================] - 18s 293ms/step - loss: 1.4657 - acc: 0.4478 - val_loss: 1.3822 - val_acc: 0.5137 Epoch 10/50 63/63 [==============================] - 18s 295ms/step - loss: 1.3718 - acc: 0.5079 - val_loss: 1.5005 - val_acc: 0.4365 Epoch 11/50 63/63 [==============================] - 18s 294ms/step - loss: 1.4599 - acc: 0.4315 - val_loss: 1.3274 - val_acc: 0.5371 Epoch 12/50 63/63 [==============================] - 18s 294ms/step - loss: 1.3166 - acc: 0.5303 - val_loss: 1.3310 - val_acc: 0.4893 Epoch 13/50 63/63 [==============================] - 18s 293ms/step - loss: 1.2977 - acc: 0.5420 - val_loss: 1.2649 - val_acc: 0.5676 Epoch 14/50 63/63 [==============================] - 18s 293ms/step - loss: 1.2627 - acc: 0.5650 - val_loss: 1.2257 - val_acc: 0.6057 Epoch 15/50 63/63 [==============================] - 18s 294ms/step - loss: 1.2643 - acc: 0.5646 - val_loss: 1.2266 - val_acc: 0.5513 Epoch 16/50 63/63 [==============================] - 18s 294ms/step - loss: 1.2112 - acc: 0.5595 - val_loss: 1.2078 - val_acc: 0.5589 Epoch 17/50 63/63 [==============================] - 18s 294ms/step - loss: 1.2148 - acc: 0.5626 - val_loss: 1.2276 - val_acc: 0.6016 Epoch 18/50 63/63 [==============================] - 18s 295ms/step - loss: 1.1910 - acc: 0.5771 - val_loss: 1.2923 - val_acc: 0.5772 Epoch 19/50 63/63 [==============================] - 18s 294ms/step - loss: 1.1599 - acc: 0.6052 - val_loss: 1.2850 - val_acc: 0.4558 Epoch 20/50 63/63 [==============================] - 18s 294ms/step - loss: 1.1581 - acc: 0.5869 - val_loss: 1.1593 - val_acc: 0.5706 Epoch 21/50 63/63 [==============================] - 18s 294ms/step - loss: 1.0972 - acc: 0.6180 - val_loss: 1.0588 - val_acc: 0.6484 Epoch 22/50 63/63 [==============================] - 18s 295ms/step - loss: 1.0492 - acc: 0.6390 - val_loss: 1.0424 - val_acc: 0.6621 Epoch 23/50 63/63 [==============================] - 18s 294ms/step - loss: 1.0525 - acc: 0.6223 - val_loss: 1.0381 - val_acc: 0.6280 Epoch 24/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9968 - acc: 0.6529 - val_loss: 1.0017 - val_acc: 0.6768 Epoch 25/50 63/63 [==============================] - 18s 294ms/step - loss: 1.0197 - acc: 0.6475 - val_loss: 1.0528 - val_acc: 0.6458 Epoch 26/50 63/63 [==============================] - 18s 295ms/step - loss: 0.9971 - acc: 0.6633 - val_loss: 1.0629 - val_acc: 0.6341 Epoch 27/50 63/63 [==============================] - 18s 294ms/step - loss: 1.0670 - acc: 0.6175 - val_loss: 1.0681 - val_acc: 0.6321 Epoch 28/50 63/63 [==============================] - 18s 293ms/step - loss: 1.0095 - acc: 0.6497 - val_loss: 0.9813 - val_acc: 0.6773 Epoch 29/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9365 - acc: 0.6759 - val_loss: 1.1566 - val_acc: 0.5523 Epoch 30/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9931 - acc: 0.6404 - val_loss: 1.0098 - val_acc: 0.6631 Epoch 31/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9619 - acc: 0.6594 - val_loss: 0.9506 - val_acc: 0.6768 Epoch 32/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9246 - acc: 0.6754 - val_loss: 0.9254 - val_acc: 0.6794 Epoch 33/50 63/63 [==============================] - 18s 294ms/step - loss: 0.8649 - acc: 0.7050 - val_loss: 0.9705 - val_acc: 0.6753 Epoch 34/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9154 - acc: 0.6726 - val_loss: 0.9514 - val_acc: 0.6596 Epoch 35/50 63/63 [==============================] - 18s 294ms/step - loss: 0.8860 - acc: 0.6828 - val_loss: 1.0110 - val_acc: 0.6590 Epoch 36/50 63/63 [==============================] - 18s 294ms/step - loss: 0.8426 - acc: 0.7078 - val_loss: 0.9094 - val_acc: 0.6845 Epoch 37/50 63/63 [==============================] - 18s 293ms/step - loss: 0.8736 - acc: 0.6833 - val_loss: 0.9704 - val_acc: 0.6174 Epoch 38/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9086 - acc: 0.6695 - val_loss: 0.9207 - val_acc: 0.6733 Epoch 39/50 63/63 [==============================] - 18s 293ms/step - loss: 0.9031 - acc: 0.6687 - val_loss: 0.8839 - val_acc: 0.6784 Epoch 40/50 63/63 [==============================] - 18s 293ms/step - loss: 0.8068 - acc: 0.7246 - val_loss: 0.8938 - val_acc: 0.6936 Epoch 41/50 63/63 [==============================] - 18s 294ms/step - loss: 0.7926 - acc: 0.7334 - val_loss: 1.0103 - val_acc: 0.6555 Epoch 42/50 63/63 [==============================] - 18s 294ms/step - loss: 0.9714 - acc: 0.6519 - val_loss: 0.8403 - val_acc: 0.7119 Epoch 43/50 63/63 [==============================] - 18s 295ms/step - loss: 0.8055 - acc: 0.7177 - val_loss: 0.7915 - val_acc: 0.7378 Epoch 44/50 63/63 [==============================] - 18s 294ms/step - loss: 0.7743 - acc: 0.7343 - val_loss: 0.8281 - val_acc: 0.7231 Epoch 45/50 63/63 [==============================] - 18s 294ms/step - loss: 0.8184 - acc: 0.6957 - val_loss: 0.7949 - val_acc: 0.7297 Epoch 46/50 63/63 [==============================] - 18s 293ms/step - loss: 0.8232 - acc: 0.7074 - val_loss: 0.8408 - val_acc: 0.7073 Epoch 47/50 63/63 [==============================] - 18s 293ms/step - loss: 0.7374 - acc: 0.7439 - val_loss: 0.7834 - val_acc: 0.7282 Epoch 48/50 63/63 [==============================] - 18s 293ms/step - loss: 0.7603 - acc: 0.7296 - val_loss: 0.8920 - val_acc: 0.6885 Epoch 49/50 63/63 [==============================] - 18s 294ms/step - loss: 0.7805 - acc: 0.7287 - val_loss: 0.8041 - val_acc: 0.7180 Epoch 50/50 63/63 [==============================] - 18s 294ms/step - loss: 0.7500 - acc: 0.7274 - val_loss: 0.7907 - val_acc: 0.7195
# creation of the model, using the resnet architecture and adding my own classes after the flattening layer
model3 = Sequential()
model3.add(resnet)
model3.add(Dense(512, activation='relu', input_dim= (224, 224, 3)))
model3.add(Dense(512, activation='relu'))
model3.add(Dense(256, activation='relu'))
model3.add(Dense(128, activation='relu'))
model3.add(Dense(num_classes, activation='softmax'))
# summary of the model
model3.summary()
# specifying a learning rate to optimizer adam
opt = tf.keras.optimizers.Adam(lr=0.001)
# compiling the model
model3.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['acc'])
# Fit the model
history = model3.fit(X, Y, validation_split=0.33, epochs=30, batch_size=128, verbose=1)
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
Model: "sequential_7" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= model (Functional) (None, 100352) 23587712 _________________________________________________________________ dense_24 (Dense) (None, 512) 51380736 _________________________________________________________________ dense_25 (Dense) (None, 512) 262656 _________________________________________________________________ dense_26 (Dense) (None, 256) 131328 _________________________________________________________________ dense_27 (Dense) (None, 128) 32896 _________________________________________________________________ dense_28 (Dense) (None, 8) 1032 ================================================================= Total params: 75,396,360 Trainable params: 51,808,648 Non-trainable params: 23,587,712 _________________________________________________________________ Epoch 1/30 125/125 [==============================] - 23s 162ms/step - loss: 3.3306 - acc: 0.2265 - val_loss: 1.8907 - val_acc: 0.0965 Epoch 2/30 125/125 [==============================] - 19s 155ms/step - loss: 1.7635 - acc: 0.2515 - val_loss: 1.6775 - val_acc: 0.2444 Epoch 3/30 125/125 [==============================] - 19s 156ms/step - loss: 1.7005 - acc: 0.2764 - val_loss: 1.6804 - val_acc: 0.3359 Epoch 4/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6895 - acc: 0.2943 - val_loss: 1.5737 - val_acc: 0.3933 Epoch 5/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6437 - acc: 0.3126 - val_loss: 1.6559 - val_acc: 0.2607 Epoch 6/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6046 - acc: 0.3256 - val_loss: 1.6319 - val_acc: 0.3755 Epoch 7/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5856 - acc: 0.3712 - val_loss: 1.5136 - val_acc: 0.4014 Epoch 8/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6163 - acc: 0.3115 - val_loss: 1.5408 - val_acc: 0.3379 Epoch 9/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6050 - acc: 0.3328 - val_loss: 1.5086 - val_acc: 0.4228 Epoch 10/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5208 - acc: 0.3971 - val_loss: 1.4521 - val_acc: 0.4177 Epoch 11/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5249 - acc: 0.3759 - val_loss: 1.4317 - val_acc: 0.4284 Epoch 12/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5959 - acc: 0.3540 - val_loss: 1.4076 - val_acc: 0.4411 Epoch 13/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4776 - acc: 0.3968 - val_loss: 1.5498 - val_acc: 0.3511 Epoch 14/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5445 - acc: 0.3452 - val_loss: 1.4903 - val_acc: 0.3623 Epoch 15/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5079 - acc: 0.3845 - val_loss: 1.5028 - val_acc: 0.3577 Epoch 16/30 125/125 [==============================] - 19s 156ms/step - loss: 1.5198 - acc: 0.3656 - val_loss: 1.4436 - val_acc: 0.4055 Epoch 17/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4661 - acc: 0.4017 - val_loss: 1.4692 - val_acc: 0.4319 Epoch 18/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4541 - acc: 0.4191 - val_loss: 1.4589 - val_acc: 0.4304 Epoch 19/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4464 - acc: 0.4090 - val_loss: 1.3845 - val_acc: 0.4507 Epoch 20/30 125/125 [==============================] - 19s 156ms/step - loss: 1.6255 - acc: 0.3409 - val_loss: 1.4332 - val_acc: 0.4177 Epoch 21/30 125/125 [==============================] - 20s 157ms/step - loss: 1.4836 - acc: 0.3810 - val_loss: 1.4319 - val_acc: 0.3857 Epoch 22/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4285 - acc: 0.4171 - val_loss: 1.3591 - val_acc: 0.4705 Epoch 23/30 125/125 [==============================] - 20s 156ms/step - loss: 1.4351 - acc: 0.4124 - val_loss: 1.3783 - val_acc: 0.4446 Epoch 24/30 125/125 [==============================] - 19s 156ms/step - loss: 1.3792 - acc: 0.4145 - val_loss: 1.3742 - val_acc: 0.4512 Epoch 25/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4214 - acc: 0.4150 - val_loss: 1.3555 - val_acc: 0.4583 Epoch 26/30 125/125 [==============================] - 19s 156ms/step - loss: 1.3855 - acc: 0.4190 - val_loss: 1.3789 - val_acc: 0.4543 Epoch 27/30 125/125 [==============================] - 19s 156ms/step - loss: 1.3519 - acc: 0.4566 - val_loss: 1.3091 - val_acc: 0.4842 Epoch 28/30 125/125 [==============================] - 19s 156ms/step - loss: 1.3783 - acc: 0.4218 - val_loss: 1.5186 - val_acc: 0.3740 Epoch 29/30 125/125 [==============================] - 19s 156ms/step - loss: 1.3650 - acc: 0.4486 - val_loss: 1.7167 - val_acc: 0.2708 Epoch 30/30 125/125 [==============================] - 19s 156ms/step - loss: 1.4661 - acc: 0.4069 - val_loss: 1.3084 - val_acc: 0.4903
Predictions on the resnet model
Angry
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are angry
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Disgust
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
Happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
Neutral
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
Surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised